﻿#region using
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using AwesomeTanks.Sources.Media;
#endregion

namespace AwesomeTanks.Sources.GameElements.ShootElements.Weapons
{
    /// <summary>
    /// Rocket launcher of the tank. Special attack.
    /// </summary>
    public class Rocket : Weapon
    {
        #region Fields

        public const int BASE_DAMAGE = 100;
        public const int RELOADING_TIME_MS = 10000;
        public const float SPEED = 1f;
        #endregion

        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="Gatling"/> class.
        /// </summary>
        public Rocket()
            : base(RELOADING_TIME_MS, SPEED, BASE_DAMAGE)
        {
        }
        #endregion

        #region Methods
        /// <summary>
        /// Fires a rocket.
        /// </summary>
        /// <param name="position">The initial position of the shot.</param>
        /// <param name="direction">The direction of the shot.</param>
        /// <param name="shooter">The shooter.</param>
        public override void Fire(Vector2 position, Vector2 direction, Player shooter)
        {
            direction.Normalize();
            Shoot rocket = new Shoot(position, direction * this.SpeedFactor, Art.SpriteSheet, Art.RocketShootSourceRectangle, this.Damages, shooter, ShootType.ROCKET);
            rocket.Color = shooter.PlayerColor;
            ShootManager.ShotList.Add(rocket);
        }
        #endregion
    }
}
